const { defineConfig } = require('@vue/cli-service')

let path = require('path');

function resolve (dir) {
  return path.join(__dirname, dir)
}

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port:8866,
    // disableHostCheck: true //  webpack 5 废弃
    historyApiFallback: true,
    allowedHosts: "all",
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      // key,value可以自行定义，比如.set('@@', resolve('src/components'))
      .set("assets", resolve("src/assets"))
      .set("components", resolve("src/components"))
      .set("utils", resolve("utils"))
  },
})
